package com.zsck.commonbase

import android.app.Application
import android.content.Context
import com.squareup.leakcanary.RefWatcher
open class BaseApp  : Application() {

    private var refWatcher: RefWatcher? = null

    companion object{
        private lateinit var baseApplication: BaseApp

        fun getContext(): Context {
            return baseApplication
        }

        fun getRefWatcher(context: Context): RefWatcher? {
            val myApplication = context.applicationContext as BaseApp
            return myApplication.refWatcher
        }

    }
    override fun onCreate() {
        super.onCreate()
        baseApplication = this
    }
}